package structures;

/**
 * Tag
 * @author Jose Antonio Prieto
 */
public class Tag {

    /**
     * Name of the taxonomy that the Tag corresponds to.
     */
    private String taxonomy;
    /**
     * Name of the tag
     */
    private String tagname;
    /**
     * Coordinate X
     */
    private int initCoordinateX;
    /**
     * Coordinate X
     */
    private int endCoordinateX;
    /**
     * Coordinate Y
     */
    private int initCoordinateY;
    /**
     * Coordinate Y
     */
    private int endCoordinateY;

    /**
     * Constructor
     */
    public Tag() {
        taxonomy = "";
        tagname = "";
        initCoordinateX = -1;
        endCoordinateX = -1;
        initCoordinateY = -1;
        endCoordinateY = -1;
    }

    /**
     * Getter
     * @return
     */
    public int getEndCoordinateX() {
        return endCoordinateX;
    }

    /**
     * Getter
     * @return
     */
    public int getEndCoordinateY() {
        return endCoordinateY;
    }

    /**
     * Getter
     * @return
     */
    public int getInitCoordinateX() {
        return initCoordinateX;
    }

    /**
     * Getter
     * @return
     */
    public int getInitCoordinateY() {
        return initCoordinateY;
    }

    /**
     * Setter
     * @param endCoordinateX
     */
    public void setEndCoordinateX(int endCoordinateX) {
        this.endCoordinateX = endCoordinateX;
    }

    /**
     * Setter
     * @param endCoordinateY
     */
    public void setEndCoordinateY(int endCoordinateY) {
        this.endCoordinateY = endCoordinateY;
    }

    /**
     * Setter
     * @param initCoordinateX
     */
    public void setInitCoordinateX(int initCoordinateX) {
        this.initCoordinateX = initCoordinateX;
    }

    /**
     * Setter
     * @param initCoordinateY
     */
    public void setInitCoordinateY(int initCoordinateY) {
        this.initCoordinateY = initCoordinateY;
    }

    /**
     * Getter
     * @return
     */
    public String getTagname() {
        return tagname;
    }

    /**
     * Setter
     * @param tagname
     */
    public void setTagname(String tagname) {
        this.tagname = tagname;
    }

    /**
     * Getter
     * @return
     */
    public String getTaxonomy() {
        return taxonomy;
    }

    /**
     * Setter
     * @param taxonomy
     */
    public void setTaxonomy(String taxonomy) {
        this.taxonomy = taxonomy;
    }

    /**
     * Print Tag
     * @return
     */
    public String toString() {
        String res = "\t<--Tag-->\n";
        if (!taxonomy.equals("")) {
            res += "\t\tTaxonomy: " + taxonomy + "\n";
        }
        if (!tagname.equals("")) {
            res += "\t\tTag name: " + tagname + "\n";
        }
        if (initCoordinateX >= 0) {
            res += "\t\t<--Coordinates-->\n";
            res += "\t\t\tInitial Coordinate X: " + initCoordinateX + "\n";
            res += "\t\t\tFinal Coordinate X: " + initCoordinateX + "\n";
            res += "\t\t\tInitial Coordinate Y: " + initCoordinateX + "\n";
            res += "\t\t\tFinal Coordinate Y: " + initCoordinateX + "\n";
        }
        return res;
    }
}
